/**
 * 
 */
package com.hst.web.auth.po;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hst.core.annotation.ResponseModel;
import com.hst.core.auth.IUser;
import com.hst.web.sys.entity.TUser;

/**
 * @author wangyh
 *
 */
@ResponseModel
public class User implements IUser, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String sid;
	private String name;
	private String id;
	private String userid;
	private String userType;
	private String companyCode;
	private String companyName;
	private String contractorCode;
	private String contractorName;
	private Timestamp updateTime;
	private List<String> privileges;

	public User(String sid,String companyCode,String contractor ,TUser user) {
		super();
		this.sid = sid;
		this.name = user.getLoginName();
		this.id = user.getId();
		this.userid = user.getOperatorNbr();
		this.userType = user.getUserType();
		this.companyCode = companyCode;
		this.contractorCode = contractor;
		this.updateTime = user.getUpdateTime();
	}

	public Timestamp getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getContractorName() {
		return contractorName;
	}

	public void setContractorName(String contractorName) {
		this.contractorName = contractorName;
	}

	public String getCompanyCode() {
		return companyCode;
	}

	public void setCompanyCode(String companyCode) {
		this.companyCode = companyCode;
	}

	public String getContractorCode() {
		return contractorCode;
	}

	public void setContractorCode(String contractorCode) {
		this.contractorCode = contractorCode;
	}

	public String getSid() {
		return sid;
	}

	public void setSid(String sid) {
		this.sid = sid;
	}



	/*
	 * (non-Javadoc)
	 * 
	 * @see com.hst.core.auth.IUser#getUserid()
	 */
	@JsonIgnore
	public String getId() {
		return id;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.hst.core.auth.IUser#getUserid()
	 */
	@Override
	public String getUserid() {
		return userid;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.hst.core.auth.IUser#getName()
	 */
	@Override
	public String getName() {
		return name;
	}
	
	public String getUserType() {
		return userType;
	}

	@JsonIgnore
	public List<String> getPrivileges() {
		return privileges;
	}

	public void setPrivileges(List<String> privileges) {
		this.privileges = privileges;
	}


	public void setId(String id) {
		this.id = id;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}
}
